#include <iostream>
#include <sw/redis++/redis++.h>
#include "util.hpp"
#include <vector>
using namespace std;
using sw::redis::Redis;
void test1(Redis &redis)
{
    redis.flushall();
    redis.zadd("key", {make_pair("zhangsan", 90), make_pair("lisi", 91), make_pair("wangwu", 92)});
    vector<string> members;
    auto it = back_inserter(members);
    redis.zrange("key", 0, -1, it);
    PrintContainer(members);
}
void test2(Redis &redis)
{
    redis.flushall();
    redis.zadd("key", {make_pair("zhangsan", 90), make_pair("lisi", 91), make_pair("wangwu", 92)});
    vector<pair<string, double>> container;
    auto it = back_inserter(container);
    redis.zrange("key", 0, -1, it);
    PrintContainer(container);
}
void test3(Redis &redis)
{
    redis.flushall();
    redis.zadd("key", {make_pair("zhangsan", 90), make_pair("lisi", 91), make_pair("wangwu", 92)});
}
int main()
{
    Redis redis("tcp://127.0.0.1:6379");
    test2(redis);
    return 0;
}